//版本号比较大小x.y.z[-p]

function* wark(str) {
  let part = '';
  let terminal = ['.', '-'];
  for (let i = 0; i < str.length; i++) {
    if (terminal.includes(str[i])) {
      yield part;
      part = '';
    } else {
      part += str[i];
    }
  }
  if (part) {
    yield part;
  }
}
for (let i of wark('1.2.c3.4')) {
  console.log(i);
}
